@extends('public.dashboard_base')
@section('title', '申请发票')

@section('content')
    <style>
        .warm_prompt ul li {
            margin-bottom: 0px;
            margin-top: 10px;
        }

        .userinfo {
            color: #666666;
            line-height: 25px;
        }

        .price {
            font-family: Verdana, Arial, Helvetica, sans-serif;
            color: #bd0800;
            font-size: 12px;
        }

        .user-account-situation {
            padding: 10px 0 0;
        }

        .user-account-situation li {
            float: left;
            width: 16%;
            min-width: 182px;
            padding: 12px 8px 6px;
            margin: 0 1% 10px 0;
            border: 1px solid #fbb57b;
        }

        /*  .normal-form {
              padding: 0 0 8px;
          }*/
        .normal-form table {
            border-collapse: collapse;
        }

        .normal-form table td, .normal-form table th {
            padding: 6px;
            border: 1px solid #fbb57b;
        }

        .normal-form table th {
            width: 30%;
            background: #f7f0ea;
            text-align: right;
            font-weight: normal;
        }

        .site-block {
            padding: 20px;
            border: 1px solid #eee;
        }

        .layui-form-label {
            width: 120px;
        }
    </style>
    <div class="control_panel_content">
        <div class="navBreadcrumb">
            <ul>
                <li>资金管理</li>
                <li><a href="/funds/invoice">申请发票</a></li>
            </ul>
        </div>
        <div class="panel">
            <div class="sub_nav_container">
                <ul class="clearfix">
                    <li class="active"><a href="/funds/invoice">申请发票</a></li>
                    <li><a href="/funds/invoice/list">发票列表</a></li>
                </ul>
            </div>
            <div class="warm_prompt">
                <ul>
                    <li><font color="red">发票金额低于500元收取15元手续费，如开票金额低于500元，请保证账户有足够的金额扣取手续费，否则审核失败！如：申请开票金额为400元，加上手续费为15元，最终开票金额为415元。</font><br>
                        请您抓紧时间申请发票，感谢您的支持！
                    </li>
                </ul>
            </div>
            {{--            <div align="left" class="userinfo">--}}
            {{--                <ul class="user-account-situation clearfix">--}}
            {{--                    <li>--}}
            {{--                        <h3 class="font12-txt">上个月未提交索取发票金额：</h3>--}}
            {{--                        <p class="price">--}}
            {{--                            0 元--}}
            {{--                        </p>--}}
            {{--                    </li>--}}
            {{--                    <li>--}}
            {{--                        <h3 class="font12-txt">本月未提交索取发票金额：</h3>--}}
            {{--                        <p class="price">--}}
            {{--                            0 元--}}
            {{--                        </p>--}}
            {{--                    </li>--}}
            {{--                    <li>--}}
            {{--                        <h3 class="font12-txt">您当前的合计可开票余额：</h3>--}}
            {{--                        <p class="price">--}}
            {{--                            0 元--}}
            {{--                        </p>--}}
            {{--                    </li>--}}
            {{--                </ul>--}}
            {{--            </div>--}}

            <div class="site-text site-block">
                <form class="layui-form ">
                    {{csrf_field()}}
                    <div class="layui-form-item">
                        <label class="layui-form-label">发票类型</label>
                        <div class="layui-input-inline">
                            <input type="text" value="增值税普通发票" lay-verify="required" disabled class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">发票内容</label>
                        <div class="layui-input-inline">
                            <input type="radio"value="2" title="网络服务费" checked="">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">开票金额</label>
                        <div class="layui-input-inline" style="width: 100px;">
                            <input type="text" name="invoice_amount" required="" lay-verify="required" placeholder="请输入金额"
                                   autocomplete="off" class="layui-input"  onkeyup="value=value.replace(/[^\d]/g,'')">
                        </div>
                        <div style="line-height: 30px"> 您目前可索取发票总额： <span class="price">123456</span>元</div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">发票抬头</label>
                        <div class="layui-input-inline" style="width: 300px;">
                            <input type="text" name="invoice_title" required="" lay-verify="required" placeholder="请输入抬头"
                                   autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">纳税人识别号</label>
                        <div class="layui-input-inline" style="width: 300px;">
                            <input type="text" name="invoice_id_num" required="" lay-verify="required" placeholder="请输入证件号"
                                   autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">电子发票接收邮箱</label>
                        <div class="layui-input-inline" style="width: 300px;">
                            <input type="text" name="receiver_email" required="" lay-verify="required" placeholder="请输入邮箱"
                                   autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">联系电话</label>
                        <div class="layui-input-inline" style="width: 300px;">
                            <input type="text" name="receiver_mobile" required="" lay-verify="required" placeholder="请输入电话"
                                   autocomplete="off" class="layui-input" onkeyup="value=value.replace(/[^\d]/g,'')">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label" style="color: #DD3C10; font-weight: 700;">温馨提醒:</label>
                        <span style="color: #DD3C10; font-weight: 700;line-height: 37px">非法出售发票犯罪，请勿非法买卖发票，否则后果自负，查看相关司法解释！
                            <a href="https://baike.baidu.com/item/%E9%9D%9E%E6%B3%95%E5%87%BA%E5%94%AE%E5%8F%91%E7%A5%A8%E7%BD%AA/8588697?fr=aladdin"
                               target="_blank">查看</a></span>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <button class="layui-btn" lay-submit="" lay-filter="submit">提交</button>
                            {{--                                <button type="reset" class="layui-btn layui-btn-primary">重置</button>--}}
                        </div>
                    </div>
                </form>
            </div>

        </div>
    </div>
@endsection
@section('script')
    <script>
        $(function () {
            var link = $("#funds-invoice");
            link.parent().parent().parent().addClass("active");
            link.parent().addClass("active");
        });
        //监听提交
        layui.form.on('submit(submit)', function(data){
            $.ajax({
             //   url: '/manager/news_del',
                type: "post",
              //  data: {'_token': '{{csrf_token()}}', 'id': obj.data.id},
                data: data.field,
                success: function (data) {
                    if (data.msg === 'success') {
                        layer.msg('成功', {icon: 1, time: 500}, function () {
                            window.location.href='invoice/list'
                        })
                    } else {
                        layer.msg(data.msg, {icon: 2});
                    }
                },
                error: function (xhr, Status, error) {
                    layer.msg(Status + ':' + xhr.responseJSON.data, {icon: 2});
                }
            });
            return false;
        });
    </script>
@endsection
